package com.cd.learn.cdlearn.pattern.combination;

/**
 * @ClassName MenuItem
 * @Description 树菜单下文件项，没有下一级，叶子节点
 * @Author seven
 * @Date 2021/7/421:21
 * @Version 1.0
 **/
public class MenuItem extends MenuComponent{

    public MenuItem(){}
    public MenuItem(String name,Integer level){
        this.name = name;
        this.level = level;
    }

    @Override
    public void showName() {
        for (Integer i = 0; i < level; i++) {
            System.out.print("-");
        }
        System.out.println(this.name);
    }


}
